package com.imooc.service;

import com.imooc.domain.Person;
import com.imooc.repository.PersonRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created on 2018/3/16.
 *
 * @author zlf
 * @since 1.0
 */
@Service
public class PersonService {

    @Autowired
    private PersonRepository personRepository;

    public List<Person> findAll() {
        return personRepository.findAll();
    }

    public Person save(Person person) {
        return personRepository.save(person);
    }

    public void deltePerson(Integer id) {
        personRepository.delete(id);
    }
}
